<template>
	<div class="view-mine">
		<mt-cell title="用户名" is-link :value="userInfo.user_name"></mt-cell>
		<mt-cell title="手机号" is-link :value="userInfo.phone"></mt-cell>
	</div>
</template>

<script>
	import { mapState, mapGetters, mapMutations, mapActions } from 'vuex';
	import _userService from '@/service/userService';
	import _sessionUser from '@/util/SessionUser';

	export default {
		name: 'Mine',
		data() {
			return {}
		},
		mounted() {
			let vm = this;
			_sessionUser.loadPage({
				scope: vm,
				exp: vm.userInfo,
				success: function() {
					vm.getUserInfo();
				}
			});
		},
		computed: {
			...mapState({
				userInfo: state => state.user.userInfo,
			}),
		},
		methods: {
			// 获取用户信息
			getUserInfo() {
				let vm = this
				let data
				let res = _userService.userInfo({
					'success': function(response) {
						data = response.data;
						console.log('用户信息接口：' + data.message);
					}
				})
				return res
			},
		}
	}
</script>

<style lang="scss" scoped>
	.view-mine {}
</style>